import {defHttp} from '/@/utils/http/axios';
import {Modal} from 'ant-design-vue';

//export const list = (params) => defHttp.get({url: Api.list, params});

//  更新商品库存
export const updateGoodsSkuStocks = params => {
  return defHttp.put({url: "/goods/goods/update/stocks", params});
};
//  获取商品分页列表
export const getGoodsListDataSeller = params => {
  return defHttp.get({url: "/manager/goods/goods/list", params });
};
//  获取商品告警分页列表
export const getGoodsListDataByStockSeller = params => {
  return defHttp.get({url: "/goods/goods/list/stock", params});
};
//  获取商品分页列表
export const getGoodsSkuListDataSeller = params => {
  return defHttp.get({url:"/goods/goods/sku/list", params});
};
//  获取商品详情
export const getGoods = id => {
  return defHttp.get({url: `/goods/goods/get/${id}`});
};
// 上架商品
export const upGoods = params => {
  return defHttp.put({url: `/goods/goods/up`, params});
};
// 删除商品
export const deleteGoods = params => {
  return defHttp.put({url: `/goods/goods/delete`, params});
};
// export const deleteOne = (params,handleSuccess) => {
//   return defHttp.delete({url: Api.category + "/" + params.id}, {joinParamsToUrl: false}).then(() => {
//     handleSuccess();
//   });
// }
//  下架商品
export const lowGoods = params => {
  return defHttp.put({url: `/goods/goods/under`, params});
};
//批量设置运费模板
export const batchShipTemplate = params => {
  return defHttp.put({url: `/goods/goods/freight`, params});
};
//下载结算单
export const downLoadGoods = () => {
  //return defHttp.get({url: `/goods/import/downLoad/`, {}, 'blob });
}
// 上传待发货的订单列表
export const uploadGoodsExcel = params => {
  //return postRequestWithNoForm(`/goods/import/import`, params });
};

//*************2025-11-05****************************************** */
export function createGoods(params) {
  return defHttp.post({url: `/store/goods/goods/create`, params}, { isTransformResponse: false});
}

export function editGoods(goodsId, params) {
  return defHttp.put({url: `/store/goods/goods/update/${goodsId}`, params}, { isTransformResponse: false});
}